package com.example.resourceSharingPlatform.service;


import com.example.resourceSharingPlatform.dao.UserDao;
import com.example.resourceSharingPlatform.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public User queryUserById(String id){
        return userDao.queryUserById(id);
    }

    public User queryUserByName(String name){
        return userDao.queryUserByName(name);
    }

    public List<User> queryAll(){
        return userDao.queryAll();
    }

    public User insertUser(User user){
        return userDao.insertUser(user);
    }

    public boolean deleteUserById(String id){
        return userDao.deleteUserById(id);
    }

    public boolean updateUser(User user){
        return userDao.updateUser(user);
    }
}
